//
// Created by 26012 on 2024/10/23.
//

#ifndef BINARYTREE_TREE_H
#define BINARYTREE_TREE_H

#include <stdio.h>
#include <stdlib.h>

typedef int ElemType;

//建立树结点
typedef struct TNode
{
    ElemType data;             //数据域
    struct TNode* left_child;  //左孩子结点
    struct TNode* right_child;  //右孩子结点
}BTree,*PBTree;

//建立队列辅助层序建树
typedef struct Queue
{
    PBTree tnode;            //指向树的结点
    struct Queue* next;  //队列下一个结点
}Queue,*PQueue;


typedef PBTree ElemType2;

typedef struct LNode{
    ElemType2 data;
    struct LNode* next;
}LinkNode;

typedef struct
{
    LinkNode *front;
    LinkNode *rear;
}LinkQueue;


void Queue_init(LinkQueue &LQ);
bool Queue_empty(LinkQueue &LQ);
void enQueue(LinkQueue &LQ,ElemType2 x);
void deQueue(LinkQueue &LQ,ElemType2 &x);
#endif //BINARYTREE_TREE_H
